<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子1-ES6/7常用语法介绍</title>
    </head>
    <body>
        <pre>
            <code>
                // 例子1

                {
                    let a = 10;
                    var b = 1;
                }

                console.log(b); // 1
                console.log(a); // ReferenceError: a is not defined

                //-------------------------------------------------

                {
                    console.log(b); // undefined
                    console.log(a); // ReferenceError: a is not defined
                    let a = 10;
                    var b = 1;
                }

                //-------------------------------------------------

                {
                    let a = 10;
                    var b = 1;
                    console.log(a); // 10
                    console.log(b); // 1
                }
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/1.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>
</html>